using Godot;
using System;

public partial class Player : CharacterBody2D
{
    public const float Speed = 300.0f;

    public override void _PhysicsProcess(double delta)
    {
        Vector2 velocity = Velocity;

        if (Input.IsKeyPressed(Key.Left))
        {
            velocity.X = -1f;
        }
        else if (Input.IsKeyPressed(Key.Right))
        {
            velocity.X = 1f;
        }


        if (Input.IsKeyPressed(Key.Up))
        {
            velocity.Y = -1f;
        }
        else if (Input.IsKeyPressed(Key.Down))
        {
            velocity.Y = 1f;
        }


        
        var result = MoveAndCollide(velocity * Speed * (float)delta);

    }
}
